<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
<div id="root">{{fullName}}</div>

</body>
<script>
    var vm = new Vue({
        el: "#root",
        data: {
            firstName: '张',
            lastName: '三'
        }, computed: {
            fullName: {
                // getter
                get:function () {
                    return this.firstName + this.lastName;
                },
                // setter
                set:function (val) {
                    console.log(val);
                     var array= val.split(" ");
                     this.firstName=array[0];
                     this.lastName=array[1];
                }
            }
        }
    })
</script>
</html>